##########################################################
###                    Glare3D Root                    ###
##########################################################

set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/__CMake__)

cmake_minimum_required (VERSION 2.8)
project (Glare3D)

set_property (GLOBAL PROPERTY USE_FOLDERS ON)

# user options
option (GLARE3D_CXX_11_FEATURES_ENABLED "Enable C++ 11 features" OFF)
option (GLARE3D_WIN8_APPSTORE_CLEAN "Disable certain features that would fail the Windows AppStore tests" OFF)

set (DEPENDENCY_DIRECTX_SDK_DIR "$ENV{DXSDK_DIR}" CACHE PATH "Path to the DirectX SDK root directory")
set (DEPENDENCY_POWER_VR_SDK_DIR "$ENV{POWER_VR_SDK}" CACHE PATH "Path to the PowerVR SDK root directory")

set (DEPENDENCY_DIRECTX_INCLUDE_DIR "${DEPENDENCY_DIRECTX_SDK_DIR}/Include")
set (DEPENDENCY_DIRECTX_LIB_DIR "${DEPENDENCY_DIRECTX_SDK_DIR}/Lib/x86")

set (DEPENDENCY_POWER_VR_INCLUDE_DIR "${DEPENDENCY_POWER_VR_SDK_DIR}/Builds/OGLES2/Include")
set (DEPENDENCY_POWER_VR_LIB_DIR "${DEPENDENCY_POWER_VR_SDK_DIR}/Builds/OGLES2/WindowsX86/Lib")

include (compiler.settings)
include (platform.build)
include (platform.config)
include (parse.arguments)

generate_platform_config()
set_compiler_warnings_as_errors()

set (PROJECT_APPLICATIONS_FOLDER "Applications")
set (PROJECT_LIBRARIES_FOLDER "Libraries")

###################
#    Libraries    #
###################
add_subdirectory(Libraries/glare.math)
add_subdirectory(Libraries/glare.core)

add_subdirectory(Libraries/glare.d3d11)
add_subdirectory(Libraries/glare.gles2)

######################
#    Applications    #
######################
add_subdirectory(Applications/Dev.Playpen)
add_subdirectory(Applications/Demo.Browser)
add_subdirectory(Applications/Tutorial.01.Driver)
add_subdirectory(Applications/Tutorial.02.MultiWindow)
